/*
 * @Description: 请输入....
 * @Author: Gavin
 * @Date: 2022-01-20 14:40:17
 * @LastEditTime: 2022-01-20 14:41:16
 * @LastEditors: Gavin
 */
const baseConfig = require('./webpack.config')
const merge = require('webpack-merge')
// const serve = require("../server/server.js");

module.exports = merge(baseConfig, {
  devtool: '#eval-source-map',
  devServer: {
    hot: true,
    compress: true,
    port: 9001,
    open: true,
    host: '0.0.0.0',
    useLocalIp: true, // 配置使用本地ip
    proxy: {
      '/api': {
        target: 'http://172.16.16.18:8888',
        pathRewrite: { '^/api': '' }
      }
    },
    before() {
      // serve.run(18888, "n");
    },
    historyApiFallback: {
      rewrites: [
        { from: /^\/add/, to: '/add.html' },
        { from: /./, to: '/index.html' }
      ]
    }
  }
})
